//
//  resumeDataSources.swift
//  万才信息App
//
//  Created by 鹏速科技 on 16/8/2.
//  Copyright © 2016年 万才信息. All rights reserved.
//

import UIKit

//语言能力 cellIndentifer:languageCell
class languageDataSource:NSObject,UITableViewDataSource{
    
    var languageList = [languageAbility]()
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return self.languageList.count
    }
    
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellIndentifer="languageCell"
        
        let cell:languageCell!=tableView.dequeueReusableCellWithIdentifier(cellIndentifer) as! languageCell
        
        let row=indexPath.row
        cell.setLanguage(self.languageList[row])
        
        return cell
    }
}

//工作经验 cell Indentifer:workCell
class workExpDataSource:NSObject,UITableViewDataSource{
    
    var workExpList = [workExperience]()
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return self.workExpList.count
    }
    
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellIndentifer="resumeListCell"
        
        let cell:workCell!=tableView.dequeueReusableCellWithIdentifier(cellIndentifer) as! workCell
        
        let row=indexPath.row
        cell.setWork(workExpList[row])
        
        return cell
    }
}

//培训经验 cell Indentifer:trainCell
class trainExpDataSource:NSObject,UITableViewDataSource{
    
    var trainExpList = [trainExperience]()
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return self.trainExpList.count
    }
    
    
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellIndentifer="trainCell"
        
        let cell:trainCell!=tableView.dequeueReusableCellWithIdentifier(cellIndentifer) as! trainCell

        let row=indexPath.row
        cell.setTrain(trainExpList[row])
        
        return cell
    }
}

//教育经验 cell Indentifer:eduCell
class eduDataSource:NSObject,UITableViewDataSource{
    
    var eduList = [listEduExperience]()
    
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return self.eduList.count
    }
    
    
    //    TODO要改写
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellIndentifer="eduCell"
        
        let cell:eduCell!=tableView.dequeueReusableCellWithIdentifier(cellIndentifer) as! eduCell
        
        let row=indexPath.row
        cell.setEdu(eduList[row])
        
        return cell
    }
}